<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>睿信教育</title>
  <link rel="stylesheet" href="../dist/lib/layui/css/layui.css">
  <link rel="stylesheet" href="../dist/lib/swiper/css/swiper.min.css">
  <link rel="stylesheet" href="../dist/css/main.css">
</head>
<body>
  <button class="layui-btn s-btn" data-id="0">导入</button>

  <button class="layui-btn add1">add1</button>

  <button class="layui-btn add2">add2</button>



<script src="../dist/lib/jquery.min.js"></script>
<script src="../dist/lib/layui/layui.js"></script>
<script>
  $('.add1').click(function () {
    $('.s-btn').attr('data-id', 1)
  });

  $('.add2').click(function () {
    $('.s-btn').attr('data-id', 2)
  });


  $(document).on('click', '.s-btn', function () {
    var _id = $(this).attr('data-id');
    alert(_id);
  });




</script>
</body>
</html>